package collection;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayToListDemo {
    public static void main(String[] args) {
        String[] array = {"one", "two", "three", "four", "five", "six"};
        System.out.println("array:" + Arrays.toString(array));

        List<String> list = Arrays.asList(array);
        System.out.println("list:" + list);

        list.set(1, "seven");
        System.out.println("list:" + list);
        System.out.println("array:" + Arrays.toString(array));


        List<String> list1 = new ArrayList<>(list);
        System.out.println("list1:" + list1);
        list1.remove(3);
        System.out.println("list1:" + list1);
        System.out.println("list:" + list);
    }
}
